package day05;

import java.util.Scanner;
import java.util.Arrays;

public class homework2 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        /**  int score = 0;
         for (int i = 1; i <= 10; i++) {
         int c = (int) (Math.random() * 100);
         int d = (int) (Math.random() * 100);
         int result = c + d;
         System.out.println("(" + i + ")" + c + "+" + d + "=?");

         int answer = scan.nextInt();
         System.out.println("算吧");
         if (answer == result) {
         System.out.println("恭喜你答对了");
         score += 10;
         }
         }
         System.out.println("总分为" + score);*/

        for (int count = 1; count <= 9; count++) {
            for (int i = 1; i <= count; i++) {
                System.out.print(i + "*" + count + "=" + i * count + "\t");
            }
            System.out.println("");
        }


        /*int[] array =new int[3];
        int[] array1={2,4,5};
        int[] array3=new int[]{1,3,6,5,};
        array[0]=3;
        array[1]=6;
        array[2]=8;
       // array[3]=4; 下标越界*/

        int[] array = new int[10];
        for (int i = 0; i < 10; i++) {
            array[i] = (int) (Math.random() * 100);
            System.out.println(array[i]);

        }
        int max = array[0];
        for (int i = 1; i <array.length; i++) {
            if (array[i]>max){
                max=array[i];
            }
        }
        System.out.println("最大值为"+max);

        int[] array1={8,1,3,4,5};
        Arrays.sort(array1);
        System.out.println("排序后");
        for (int i = 0; i <array1.length; i++) {
            System.out.println(array1[i]);
        }



    }
}


